package com.itheima.mymap;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;

public class MyHashMapDemo {
    public static void main(String[] args) {
        HashMap<String,String> hm = new HashMap<>();
        new Thread(()->{
            for (int i = 0; i < 25; i++) {
                hm.put(i + "",i + "");
            }
        }).start();

        new Thread(()->{
            for (int i = 25; i < 51; i++) {
                hm.put(i + "",i + "");
            }
        }).start();


        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        for (int i = 0; i < 51; i++) {
            System.out.println(hm.get(i + ""));
        }
    }
}
